package com.demo.svc;

import java.io.IOException;
import java.io.OutputStream;
import java.util.List;

import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.DeserializationConfig.Feature;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.stereotype.Service;

import com.demo.domain.JsonDomain;

@Service("jsonTest")
public class JsonTest {
	
	public void testJson(String json) throws Exception{
		
		ObjectMapper obm = new ObjectMapper();
		
		//bm .configure(Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
		
		
		JsonDomain[] jary=obm.readValue(json, JsonDomain[].class);
		
		System.out.println(jary[0].toString());
		System.out.println(jary[1].toString());
		
		
	}
}
